// ignore_for_file: non_constant_identifier_names

import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:get/instance_manager.dart';
import 'package:loading_indicator/loading_indicator.dart';
import 'package:get/get.dart';

class MToast {
  static void ShowLoading(String? msg) {
    EasyLoading().indicatorType = EasyLoadingIndicatorType.cubeGrid;
    EasyLoading().userInteractions = false;
    EasyLoading().indicatorColor = Colors.red;
    EasyLoading.show(status: msg);
  }

  static void HiddenLoading() {
    EasyLoading.dismiss();
  }

  static void ShowMessage(String msg) {
    EasyLoading().backgroundColor = Colors.black12;
    EasyLoading().maskColor = Colors.white10;
    EasyLoading.showToast(msg,
        maskType: EasyLoadingMaskType.custom,
        duration: const Duration(seconds: 3));
  }

// static void ShowToast(String msg) {
//     Fluttertoast.showToast(
//         msg: msg,
//         toastLength: Toast.LENGTH_SHORT,
//         gravity: ToastGravity.CENTER,
//         timeInSecForIosWeb: 3,
//         backgroundColor: Colors.black12,
//         textColor: Colors.black,
//         fontSize: 16);
//   }

  // static void ShowLoading(String? msg) {
  //   Center(
  //     child: const LoadingIndicator(
  //       indicatorType: Indicator.ballClipRotateMultiple,
  //       colors: [Colors.red],
  //       strokeWidth: 60,
  //       backgroundColor: Colors.white,
  //       pathBackgroundColor: Colors.white,
  //     ),
  //   );
  // }
}
